package com.doradance.app.home;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.doradance.R;
import com.doradance.account.utils.FragmentUtils;
import com.pachong.android.baseuicomponent.activity.BaseActivity;

public class MoreVideoActivity extends BaseActivity {
    private int type;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        type = getIntent().getIntExtra("type", -1);
        initToolsBar();
    }

    private void initToolsBar() {
        setTitle("更多视频");
        getCustomToolbar().addLeftImageButton(R.mipmap.back, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        MoreVideoFragment moreVideoFragment = new MoreVideoFragment(type);
        FragmentUtils.replaceFragment(getSupportFragmentManager(),R.id.fl_more_video,moreVideoFragment);
    }

    public static void start(Activity activity,int type){
        Intent intent = new Intent(activity, MoreVideoActivity.class);
        intent.putExtra("type",type);
        activity.startActivity(intent);
    }

    @Override
    public View createDataView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.activity_more_video,null);
    }
}
